package com.globalresources.dao.inface;

import java.util.List;

import com.globalresources.commons.vo.UserAndDocumentWrapper;
import com.globalresources.po.Document;
import com.globalresources.ui.struts.action.document.vo.PatientDocument;
import com.trg.dao.dao.standard.GenericDAO;

/**
 * @author aaron.lu(luzhiyuan) E-mail:atyuan.lu@gmail.com
 * @since 创建时间：Jul 19, 2009 10:19:06 AM
 * @version 0.0.2
 * @author chenheng 
 * 2009-09-23 16:14
 */
public interface IDocumentDao extends GenericDAO<Document, Integer>{
	
	
	/**
	 * get documents 
	*@author aaron.lu(luzhiyuan)
	*@param userid
	*@param isSign
	*@param isView
	*@return
	 */
	public List<Document> getDocuments(Integer userid, Byte isSign, Byte isView);
	
	/**
	 * get Documents By Pager
	*@author songduanlei@gmail.com
	*@param userid
	*@param isSign
	*@param isView
	*@param pageSize
	*@return
	 */
	public List<Document> getDocumentsByPager(Integer userid, Byte isSign, Byte isView,int currentPage,int pageSize);
	
	
	
	/**
	 * count documents
	*@author aaron.lu(luzhiyuan)
	*@param userid
	*@param isSign
	*@param isView
	*@return
	 */
	public int countDocuments(Integer userid, Byte isSign, Byte isView);
	
	/**
	 * load hospital's documents 
	*@author liming.yu(yulm88@gmail.com)
	*@param hospitalid 医院编号
	*@param isSign  是否签名
	*@param isView   
	*@return
	 */
	public List<Document> getHospitalDocuments(Integer hospitalid, 
			Byte isSign, Byte isView);
	
	/**
	 * count hospital's documents 
	*@author liming.yu(yulm88@gmail.com)
	*@param hospitalid 医院编号
	*@param isSign  是否签名
	*@param isView   
	*@return
	 */
	public int countHospitalDocuments(Integer hospitalid, Byte isSign, Byte isView);
	
	/**
	 * <p>查询医院所有文档列表
	*@author aaron.lu(luzhiyuan)
	*@param hospital_id
	*@return
	 */
	public List<Document> getAllDocumentInHospital(Integer hospital_id);
	
	/**
	 * <p>使用存储过程查询统计报表
	*@author aaron.lu(luzhiyuan)
	*@param hospital_id
	*@param order_flag
	*@return
	 */
	public List<UserAndDocumentWrapper> getDocuemntSum(final Integer hospital_id, final String order_flag);

	
	
	/***
	 * 更新document
	 * 
	 * **/
	public boolean saveOrUpdate(Document document);
	
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的所有文档
	 * @param caseNumber
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<Document> getDocumentByPatient(String caseNumber,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的所有文档数
	 * @param caseNumber
	 * @return
	 */
	public int getDocumentNumByPatient(String caseNumber);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的已签名(未签名)文档数
	 * @param caseNumber
	 * @param isSign
	 * @return
	 */
	public int getSignDocumentNumByPatient(String caseNumber,byte isSign);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的已签名（未签名）文档
	 * @param caseNumber
	 * @param currentPage
	 * @param pageSize
	 * @param isSign
	 * @return
	 */
	public List<Document> getSignDocumentByPatient(String caseNumber,byte isSign,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 查询所有的病人
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<PatientDocument> getPatient(final int currentPage ,final int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 查询病人人数
	 * @return
	 */
	public int getPatientNum();
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据列出的条件搜索文档
	 * @param conditions
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<PatientDocument> getDocumentByCondition(PatientDocument patientDocument,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据列出的条件搜索文档数
	 * @param conditions
	 * @return
	 */
	public int getDocumentNumByCondition(PatientDocument patientDocument);
}
